﻿#include <iostream>
#include <string>
#include <algorithm>
#include <cppunit/config/SourcePrefix.h>
#include "TestPKBRelationship.h"

void PKBRelationshipTest::setUp(){
	pkb = PKB::getInstance();
	pkb->clear();
}

void PKBRelationshipTest::tearDown(){
}
//Procedure proc1{
//	w = 5;								//1
//	while w{							//2
//		x = 1;							//3
//		y = 2;							//4
//		if x then{						//5
//			z = x + y;					//6
//		}else{
//			z = w + x;					//7
//			while y{					//8
//				w = y + z;				//9
//			}
//			call proc2;					//10
//		}
//		y = w + z;						//11
//		call proc3;						//12
//		while y{						//13
//			z = y + x;					//14
//			if z then{					//15
//				x = h + k + w;			//16
//				j = x +  y + z;			//17
//			} else {
//				h = x + y;				//18
//				if k then {				//19
//					y = y + w + j;		//20
//				} else {
//					h = y + w;			//21
//				}
//				k = h + j + y;			//22
//			}
//		}
//	}
//}
//
//Procedure proc2{
//	w = z + 2;							//23
//	if y then{							//24
//		call proc3;						//25
//	} else {
//		x = x + 5;						//26
//	}
//}
//
//Procedure proc3{
// y = k + j;							//27
//	while i {								//28
//		h = j + k + y;					//29
//		if w then {						//30
//			w = z + i;					//31
//		} else {
//			i = y + j + k + w;		//32
//		}
//		y = w + z;						//33
//	}
//	y = y + z + x - w;				//34
//}

void PKBRelationshipTest::testInsertProc(){
	pkb = PKB::getInstance();
	
	CPPUNIT_ASSERT(pkb->insertProc("proc1"));
	CPPUNIT_ASSERT(pkb->insertProc("proc2"));
	CPPUNIT_ASSERT(pkb->insertProc("proc3"));
}

void PKBRelationshipTest::testGetProc(){
	pkb = PKB::getInstance();
	
	CPPUNIT_ASSERT_EQUAL(1, pkb->getProcIndex("proc1"));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getProcIndex("proc2"));
	CPPUNIT_ASSERT_EQUAL(3, pkb->getProcIndex("proc3"));

	CPPUNIT_ASSERT_EQUAL(std::string("proc1"), pkb->getProcName(1));
	CPPUNIT_ASSERT_EQUAL(std::string("proc2"), pkb->getProcName(2));
	CPPUNIT_ASSERT_EQUAL(std::string("proc3"), pkb->getProcName(3));

	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getProcIndices()).size());
}

void PKBRelationshipTest::testSetProcStartEnd(){
	pkb = PKB::getInstance();
	
	CPPUNIT_ASSERT(pkb->insertProcStartEnd(1, 1, 22));
	CPPUNIT_ASSERT(pkb->insertProcStartEnd(2, 23, 26));
	CPPUNIT_ASSERT(pkb->insertProcStartEnd(3, 27, 34));
}

void PKBRelationshipTest::testGetProcStartEnd(){
	pkb = PKB::getInstance();
	Type::Pair::StartEnd tmpPair;

	tmpPair = pkb->getProcStartEnd(1);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("start of proc1", 1, tmpPair.first);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("end of proc1", 22, tmpPair.second);

	tmpPair = pkb->getProcStartEnd(2);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("start of proc2", 23, tmpPair.first);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("end of proc2", 26, tmpPair.second);

	tmpPair = pkb->getProcStartEnd(3);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("start of proc3", 27, tmpPair.first);
	CPPUNIT_ASSERT_EQUAL_MESSAGE("end of proc3", 34, tmpPair.second);
}

void PKBRelationshipTest::testInsertVar(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL(1, pkb->insertVar("h"));
	CPPUNIT_ASSERT_EQUAL(2, pkb->insertVar("i"));
	CPPUNIT_ASSERT_EQUAL(3, pkb->insertVar("j"));
	CPPUNIT_ASSERT_EQUAL(4, pkb->insertVar("k"));
	CPPUNIT_ASSERT_EQUAL(5, pkb->insertVar("w"));
	CPPUNIT_ASSERT_EQUAL(6, pkb->insertVar("x"));
	CPPUNIT_ASSERT_EQUAL(7, pkb->insertVar("y"));
	CPPUNIT_ASSERT_EQUAL(8, pkb->insertVar("z"));
}

void PKBRelationshipTest::testGetVar(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL(1, pkb->getVarIndex("h"));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getVarIndex("i"));
	CPPUNIT_ASSERT_EQUAL(3, pkb->getVarIndex("j"));
	CPPUNIT_ASSERT_EQUAL(4, pkb->getVarIndex("k"));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getVarIndex("w"));
	CPPUNIT_ASSERT_EQUAL(6, pkb->getVarIndex("x"));
	CPPUNIT_ASSERT_EQUAL(7, pkb->getVarIndex("y"));
	CPPUNIT_ASSERT_EQUAL(8, pkb->getVarIndex("z"));

	CPPUNIT_ASSERT_EQUAL(std::string("h"), pkb->getVarName(1));
	CPPUNIT_ASSERT_EQUAL(std::string("i"), pkb->getVarName(2));
	CPPUNIT_ASSERT_EQUAL(std::string("j"), pkb->getVarName(3));
	CPPUNIT_ASSERT_EQUAL(std::string("k"), pkb->getVarName(4));
	CPPUNIT_ASSERT_EQUAL(std::string("w"), pkb->getVarName(5));
	CPPUNIT_ASSERT_EQUAL(std::string("x"), pkb->getVarName(6));
	CPPUNIT_ASSERT_EQUAL(std::string("y"), pkb->getVarName(7));
	CPPUNIT_ASSERT_EQUAL(std::string("z"), pkb->getVarName(8));

	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getVarIndices()).size());
}

void PKBRelationshipTest::testInsertConstant(){
	pkb = PKB::getInstance();
	
	CPPUNIT_ASSERT(pkb->insertConstant(1, Type::Entity::ALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->insertConstant(2, Type::Entity::ALL_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->insertConstant(3, Type::Entity::ALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->insertConstant(23, Type::Entity::ALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->insertConstant(26, Type::Entity::ALL_LINE_ENTITY, 5));
}

void PKBRelationshipTest::testGetConstant(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getConstantsAtLine(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getConstantsAtLine(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getConstantsAtLine(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getConstantsAtLine(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getConstantsAtLine(26)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getConstants()).size());
}

void PKBRelationshipTest::testInsertLineEntity(){
	pkb = PKB::getInstance();

	// procedure 1
	CPPUNIT_ASSERT(pkb->insertLineEntity(1, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(2, Type::Entity::WHILE_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(3, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(4, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(5, Type::Entity::IF_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(6, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(7, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(8, Type::Entity::WHILE_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(9, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(10, Type::Entity::CALL_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(11, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(12, Type::Entity::CALL_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(13, Type::Entity::WHILE_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(14, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(15, Type::Entity::IF_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(16, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(17, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(18, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(19, Type::Entity::IF_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(20, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(21, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(22, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	// procedure 2
	CPPUNIT_ASSERT(pkb->insertLineEntity(23, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(24, Type::Entity::IF_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(25, Type::Entity::CALL_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(26, Type::Entity::ASSIGNMENT_LINE_ENTITY));

	// procedure 3
	CPPUNIT_ASSERT(pkb->insertLineEntity(27, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(28, Type::Entity::WHILE_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(29, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(30, Type::Entity::IF_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(31, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(32, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(33, Type::Entity::ASSIGNMENT_LINE_ENTITY));
	CPPUNIT_ASSERT(pkb->insertLineEntity(34, Type::Entity::ASSIGNMENT_LINE_ENTITY));
}

void PKBRelationshipTest::testGetLineEntity(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getLineEntities()).size());

	// procedure 1
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(1));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::WHILE_LINE_ENTITY, pkb->getLineEntityByLine(2));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(3));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(4));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::IF_LINE_ENTITY, pkb->getLineEntityByLine(5));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(6));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(7));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::WHILE_LINE_ENTITY, pkb->getLineEntityByLine(8));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(9));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::CALL_LINE_ENTITY, pkb->getLineEntityByLine(10));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(11));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::CALL_LINE_ENTITY, pkb->getLineEntityByLine(12));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::WHILE_LINE_ENTITY, pkb->getLineEntityByLine(13));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(14));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::IF_LINE_ENTITY, pkb->getLineEntityByLine(15));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(16));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(17));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(18));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::IF_LINE_ENTITY, pkb->getLineEntityByLine(19));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(20));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(21));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(22));

	// procedure 2
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(23));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::IF_LINE_ENTITY, pkb->getLineEntityByLine(24));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::CALL_LINE_ENTITY, pkb->getLineEntityByLine(25));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(26));

	// procedure 3
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(27));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::WHILE_LINE_ENTITY, pkb->getLineEntityByLine(28));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(29));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::IF_LINE_ENTITY, pkb->getLineEntityByLine(30));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(31));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(32));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(33));
	CPPUNIT_ASSERT_EQUAL(Type::Entity::ASSIGNMENT_LINE_ENTITY, pkb->getLineEntityByLine(34));
}

void PKBRelationshipTest::testSetUses(){
	pkb = PKB::getInstance();

	// procedure 1
	CPPUNIT_ASSERT(pkb->setProcUses(1, 1));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 2));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 3));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 4));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 5));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 6));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 7));
	CPPUNIT_ASSERT(pkb->setProcUses(1, 8));

	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(2, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(5, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(5, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(5, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(5, Type::Entity::IF_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(6, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(6, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(7, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(7, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(8, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(8, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(9, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(9, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(10, Type::Entity::CALL_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(11, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(11, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(12, Type::Entity::CALL_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(13, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(14, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(14, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(15, Type::Entity::IF_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(16, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineUses(16, Type::Entity::ASSIGNMENT_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(16, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(17, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(17, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(17, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(18, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(18, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(19, Type::Entity::IF_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(19, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(19, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(20, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(20, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(20, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(21, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(21, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(22, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineUses(22, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(22, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));

	// procedure 2
	CPPUNIT_ASSERT(pkb->setProcUses(2, 2));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 3));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 4));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 5));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 6));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 7));
	CPPUNIT_ASSERT(pkb->setProcUses(2, 8));

	CPPUNIT_ASSERT(pkb->setLineUses(23, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(24, Type::Entity::IF_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(25, Type::Entity::CALL_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(26, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	
	// procedure 3
	CPPUNIT_ASSERT(pkb->setProcUses(3, 2));
	CPPUNIT_ASSERT(pkb->setProcUses(3, 3));
	CPPUNIT_ASSERT(pkb->setProcUses(3, 4));
	CPPUNIT_ASSERT(pkb->setProcUses(3, 5));
	CPPUNIT_ASSERT(pkb->setProcUses(3, 7));
	CPPUNIT_ASSERT(pkb->setProcUses(3, 8));
	
	CPPUNIT_ASSERT(pkb->setLineUses(27, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(27, Type::Entity::ASSIGNMENT_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(28, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(29, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(29, Type::Entity::ASSIGNMENT_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(29, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(30, Type::Entity::IF_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(31, Type::Entity::ASSIGNMENT_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineUses(31, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(32, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineUses(32, Type::Entity::ASSIGNMENT_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineUses(32, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(32, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(33, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(33, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineUses(34, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineUses(34, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineUses(34, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineUses(34, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
}

void PKBRelationshipTest::testGetUses(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getUsedVars()).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getUsedVarsByLine(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getUsedVarsByLine(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getUsedVarsByLine(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getUsedVarsByLine(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getUsedVarsByLine(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 7, (pkb->getUsedVarsByLine(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByLine(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 7, (pkb->getUsedVarsByLine(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByLine(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(22)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getUsedVarsByLine(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 7, (pkb->getUsedVarsByLine(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByLine(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getUsedVarsByLine(26)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByLine(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getUsedVarsByLine(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByLine(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getUsedVarsByLine(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getUsedVarsByLine(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getUsedVarsByLine(34)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getUsedVarsByProc(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 7, (pkb->getUsedVarsByProc(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getUsedVarsByProc(3)).size());
}

void PKBRelationshipTest::testSetModifies(){
	pkb = PKB::getInstance();

	// procedure 1
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 1));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 2));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 3));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 4));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 5));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 6));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 7));
	CPPUNIT_ASSERT(pkb->setProcModifies(1, 8));

	CPPUNIT_ASSERT(pkb->setLineModifies(1, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(2, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(3, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(4, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(5, Type::Entity::IF_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(6, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(7, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(8, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(9, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(10, Type::Entity::CALL_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(10, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(10, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(10, Type::Entity::CALL_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(10, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(11, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(12, Type::Entity::CALL_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(12, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(12, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(12, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(13, Type::Entity::WHILE_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(14, Type::Entity::ASSIGNMENT_LINE_ENTITY, 8));
	CPPUNIT_ASSERT(pkb->setLineModifies(15, Type::Entity::IF_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(15, Type::Entity::IF_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineModifies(15, Type::Entity::IF_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineModifies(15, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(15, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(16, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(17, Type::Entity::ASSIGNMENT_LINE_ENTITY, 3));
	CPPUNIT_ASSERT(pkb->setLineModifies(18, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(19, Type::Entity::IF_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(19, Type::Entity::IF_LINE_ENTITY, 4));
	CPPUNIT_ASSERT(pkb->setLineModifies(19, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(20, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(21, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(22, Type::Entity::ASSIGNMENT_LINE_ENTITY, 4));

	// procedure 2
	CPPUNIT_ASSERT(pkb->setProcModifies(2, 1));
	CPPUNIT_ASSERT(pkb->setProcModifies(2, 2));
	CPPUNIT_ASSERT(pkb->setProcModifies(2, 5));
	CPPUNIT_ASSERT(pkb->setProcModifies(2, 6));
	CPPUNIT_ASSERT(pkb->setProcModifies(2, 7));

	CPPUNIT_ASSERT(pkb->setLineModifies(23, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(24, Type::Entity::IF_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(24, Type::Entity::IF_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(24, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(24, Type::Entity::IF_LINE_ENTITY, 6));
	CPPUNIT_ASSERT(pkb->setLineModifies(24, Type::Entity::IF_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(25, Type::Entity::CALL_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(25, Type::Entity::CALL_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(25, Type::Entity::CALL_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(25, Type::Entity::CALL_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(26, Type::Entity::ASSIGNMENT_LINE_ENTITY, 6));

	// procedure 3
	CPPUNIT_ASSERT(pkb->setProcModifies(3, 1));
	CPPUNIT_ASSERT(pkb->setProcModifies(3, 2));
	CPPUNIT_ASSERT(pkb->setProcModifies(3, 5));
	CPPUNIT_ASSERT(pkb->setProcModifies(3, 7));

	CPPUNIT_ASSERT(pkb->setLineModifies(27, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(28, Type::Entity::WHILE_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(28, Type::Entity::WHILE_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(28, Type::Entity::WHILE_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(29, Type::Entity::ASSIGNMENT_LINE_ENTITY, 1));
	CPPUNIT_ASSERT(pkb->setLineModifies(30, Type::Entity::IF_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(30, Type::Entity::IF_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(31, Type::Entity::ASSIGNMENT_LINE_ENTITY, 5));
	CPPUNIT_ASSERT(pkb->setLineModifies(32, Type::Entity::ASSIGNMENT_LINE_ENTITY, 2));
	CPPUNIT_ASSERT(pkb->setLineModifies(33, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
	CPPUNIT_ASSERT(pkb->setLineModifies(34, Type::Entity::ASSIGNMENT_LINE_ENTITY, 7));
}

void PKBRelationshipTest::testGetModifes(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getModifiedVars()).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getModifiedVarsByLine(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getModifiedVarsByLine(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getModifiedVarsByLine(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getModifiedVarsByLine(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getModifiedVarsByLine(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getModifiedVarsByLine(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getModifiedVarsByLine(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(22)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getModifiedVarsByLine(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getModifiedVarsByLine(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(26)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getModifiedVarsByLine(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getModifiedVarsByLine(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getModifiedVarsByLine(34)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 8, (pkb->getModifiedVarsByProc(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getModifiedVarsByProc(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getModifiedVarsByProc(3)).size());
}

void PKBRelationshipTest::testSetParent(){
	pkb = PKB::getInstance();

	// procedure 1
	pkb->setParent(2, 3);
	pkb->setParent(2, 4);
	pkb->setParent(2, 5);
	pkb->setParent(2, 11);
	pkb->setParent(2, 12);
	pkb->setParent(2, 13);
	pkb->setParent(5, 6);
	pkb->setParent(5, 7);
	pkb->setParent(5, 8);
	pkb->setParent(5, 10);
	pkb->setParent(8, 9);
	pkb->setParent(13, 14);
	pkb->setParent(13, 15);
	pkb->setParent(15, 16);
	pkb->setParent(15, 17);
	pkb->setParent(15, 18);
	pkb->setParent(15, 19);
	pkb->setParent(15, 22);
	pkb->setParent(19, 20);
	pkb->setParent(19, 21);

	// procedure 2
	pkb->setParent(24, 25);
	pkb->setParent(24, 26);

	// procedure 3
	pkb->setParent(28, 29);
	pkb->setParent(28, 30);
	pkb->setParent(28, 33);
	pkb->setParent(30, 31);
	pkb->setParent(30, 32);
}

void PKBRelationshipTest::testGetParent(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(1));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(2));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(3));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(4));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(5));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getParent(6));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getParent(7));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getParent(8));
	CPPUNIT_ASSERT_EQUAL(8, pkb->getParent(9));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getParent(10));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(11));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(12));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getParent(13));
	CPPUNIT_ASSERT_EQUAL(13, pkb->getParent(14));
	CPPUNIT_ASSERT_EQUAL(13, pkb->getParent(15));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getParent(16));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getParent(17));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getParent(18));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getParent(19));
	CPPUNIT_ASSERT_EQUAL(19, pkb->getParent(20));
	CPPUNIT_ASSERT_EQUAL(19, pkb->getParent(21));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getParent(22));

	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(23));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(24));
	CPPUNIT_ASSERT_EQUAL(24, pkb->getParent(25));
	CPPUNIT_ASSERT_EQUAL(24, pkb->getParent(26));

	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(27));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(28));
	CPPUNIT_ASSERT_EQUAL(28, pkb->getParent(29));
	CPPUNIT_ASSERT_EQUAL(28, pkb->getParent(30));
	CPPUNIT_ASSERT_EQUAL(30, pkb->getParent(31));
	CPPUNIT_ASSERT_EQUAL(30, pkb->getParent(32));
	CPPUNIT_ASSERT_EQUAL(28, pkb->getParent(33));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getParent(34));

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getParentStar(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getParentStar(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getParentStar(22)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(26)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getParentStar(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getParentStar(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getParentStar(34)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getChild(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getChild(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getChild(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChild(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getChild(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChild(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(22)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChild(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(26)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getChild(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChild(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChild(34)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 20, (pkb->getChildStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getChildStar(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getChildStar(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 9, (pkb->getChildStar(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 7, (pkb->getChildStar(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChildStar(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(22)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChildStar(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(26)).size());
	
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getChildStar(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getChildStar(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getChildStar(34)).size());
}

void PKBRelationshipTest::testSetFollow(){
	pkb = PKB::getInstance();

	// procedure 1
	pkb->setFollows(1, 2);
	pkb->setFollows(3, 4);
	pkb->setFollows(4, 5);
	pkb->setFollows(5, 11);
	pkb->setFollows(11, 12);
	pkb->setFollows(12, 13);
	pkb->setFollows(7, 8);
	pkb->setFollows(8, 10);
	pkb->setFollows(14, 15);
	pkb->setFollows(16, 17);
	pkb->setFollows(18, 19);
	pkb->setFollows(19, 22);

	// procedure 2
	pkb->setFollows(23, 24);

	// procedure 3
	pkb->setFollows(27, 28);
	pkb->setFollows(28, 34);
	pkb->setFollows(29, 30);
	pkb->setFollows(30, 33);
}

void PKBRelationshipTest::testGetFollow(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL(2, pkb->getFollows(1));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(2));
	CPPUNIT_ASSERT_EQUAL(4, pkb->getFollows(3));
	CPPUNIT_ASSERT_EQUAL(5, pkb->getFollows(4));
	CPPUNIT_ASSERT_EQUAL(11, pkb->getFollows(5));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(6));
	CPPUNIT_ASSERT_EQUAL(8, pkb->getFollows(7));
	CPPUNIT_ASSERT_EQUAL(10, pkb->getFollows(8));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(9));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(10));
	CPPUNIT_ASSERT_EQUAL(12, pkb->getFollows(11));
	CPPUNIT_ASSERT_EQUAL(13, pkb->getFollows(12));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(13));
	CPPUNIT_ASSERT_EQUAL(15, pkb->getFollows(14));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(15));
	CPPUNIT_ASSERT_EQUAL(17, pkb->getFollows(16));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(17));
	CPPUNIT_ASSERT_EQUAL(19, pkb->getFollows(18));
	CPPUNIT_ASSERT_EQUAL(22, pkb->getFollows(19));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(20));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(21));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(22));

	CPPUNIT_ASSERT_EQUAL(24, pkb->getFollows(23));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(24));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(25));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(26));

	CPPUNIT_ASSERT_EQUAL(28, pkb->getFollows(27));
	CPPUNIT_ASSERT_EQUAL(34, pkb->getFollows(28));
	CPPUNIT_ASSERT_EQUAL(30, pkb->getFollows(29));
	CPPUNIT_ASSERT_EQUAL(33, pkb->getFollows(30));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(31));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(32));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(33));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getFollows(34));

	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 5, (pkb->getFollowStar(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getFollowStar(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getFollowStar(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getFollowStar(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getFollowStar(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getFollowStar(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(22)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(26)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getFollowStar(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getFollowStar(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getFollowStar(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getFollowStar(34)).size());
}

void PKBRelationshipTest::testSetCall(){
	pkb = PKB::getInstance();

	// procedure 1
	CPPUNIT_ASSERT(pkb->setCalls(1, 10, 2));
	CPPUNIT_ASSERT(pkb->setCalls(1, 12, 3));

	// procedure 2
	CPPUNIT_ASSERT(pkb->setCalls(2, 25, 3));
}

void PKBRelationshipTest::testGetCall(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(1));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(2));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(3));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(4));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(5));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(6));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(7));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(8));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(9));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getCalledByLine(10));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(11));
	CPPUNIT_ASSERT_EQUAL(3, pkb->getCalledByLine(12));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(13));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(14));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(15));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(16));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(17));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(18));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(19));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(20));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(21));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(22));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(23));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(24));
	CPPUNIT_ASSERT_EQUAL(3, pkb->getCalledByLine(25));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(26));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(27));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(28));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(29));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(30));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(31));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(32));

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getCalledByLineStar(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCalledByLineStar(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(22)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCalledByLineStar(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(26)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByLineStar(32)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getCalledBy(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCalledBy(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledBy(3)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getCalledByStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCalledByStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCalledByStar(3)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCallerLineOf(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCallerLineOf(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getCallerLineOf(3)).size());

	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getCallerLineOfStar(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getCallerLineOfStar(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getCallerLineOfStar(3)).size());
}

void PKBRelationshipTest::testSetLastOfContainer(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT(pkb->setLastOfIf(5,6,10));
	CPPUNIT_ASSERT(pkb->setLastOfIf(15,17,22));
	CPPUNIT_ASSERT(pkb->setLastOfIf(19,20,21));
	CPPUNIT_ASSERT(pkb->setLastOfIf(24,25,26));
	CPPUNIT_ASSERT(pkb->setLastOfIf(30,31,32));

	CPPUNIT_ASSERT(pkb->setLastOfWhile(2,22));
	CPPUNIT_ASSERT(pkb->setLastOfWhile(8,9));
	CPPUNIT_ASSERT(pkb->setLastOfWhile(13,22));
	CPPUNIT_ASSERT(pkb->setLastOfWhile(28,33));
}

void PKBRelationshipTest::testGetAffects(){
	pkb = PKB::getInstance();

	CPPUNIT_ASSERT(!pkb->isAffects(1,1));
	CPPUNIT_ASSERT(!pkb->isAffects(1,3));
	CPPUNIT_ASSERT(!pkb->isAffects(1,4));
	CPPUNIT_ASSERT(!pkb->isAffects(1,6));
	CPPUNIT_ASSERT(pkb->isAffects(1,7));
	CPPUNIT_ASSERT(!pkb->isAffects(1,9));
	CPPUNIT_ASSERT(pkb->isAffects(1,11));
	CPPUNIT_ASSERT(!pkb->isAffects(1,14));
	CPPUNIT_ASSERT(!pkb->isAffects(1,16));
	CPPUNIT_ASSERT(!pkb->isAffects(1,17));
	CPPUNIT_ASSERT(!pkb->isAffects(1,18));
	CPPUNIT_ASSERT(!pkb->isAffects(1,20));
	CPPUNIT_ASSERT(!pkb->isAffects(1,21));
	CPPUNIT_ASSERT(!pkb->isAffects(1,22));
	CPPUNIT_ASSERT(!pkb->isAffects(1,23));
	CPPUNIT_ASSERT(!pkb->isAffects(1,26));
	CPPUNIT_ASSERT(!pkb->isAffects(1,27));
	CPPUNIT_ASSERT(!pkb->isAffects(1,29));
	CPPUNIT_ASSERT(!pkb->isAffects(1,31));
	CPPUNIT_ASSERT(!pkb->isAffects(1,32));
	CPPUNIT_ASSERT(!pkb->isAffects(1,33));
	CPPUNIT_ASSERT(!pkb->isAffects(1,34));

	CPPUNIT_ASSERT(!pkb->isAffects(3,1));
	CPPUNIT_ASSERT(!pkb->isAffects(3,3));
	CPPUNIT_ASSERT(!pkb->isAffects(3,4));
	CPPUNIT_ASSERT(pkb->isAffects(3,6));
	CPPUNIT_ASSERT(pkb->isAffects(3,7));
	CPPUNIT_ASSERT(!pkb->isAffects(3,9));
	CPPUNIT_ASSERT(!pkb->isAffects(3,11));
	CPPUNIT_ASSERT(pkb->isAffects(3,14));
	CPPUNIT_ASSERT(!pkb->isAffects(3,16));
	CPPUNIT_ASSERT(!pkb->isAffects(3,17));
	CPPUNIT_ASSERT(pkb->isAffects(3,18));
	CPPUNIT_ASSERT(!pkb->isAffects(3,20));
	CPPUNIT_ASSERT(!pkb->isAffects(3,21));
	CPPUNIT_ASSERT(!pkb->isAffects(3,22));
	CPPUNIT_ASSERT(!pkb->isAffects(3,23));
	CPPUNIT_ASSERT(!pkb->isAffects(3,26));
	CPPUNIT_ASSERT(!pkb->isAffects(3,27));
	CPPUNIT_ASSERT(!pkb->isAffects(3,29));
	CPPUNIT_ASSERT(!pkb->isAffects(3,31));
	CPPUNIT_ASSERT(!pkb->isAffects(3,32));
	CPPUNIT_ASSERT(!pkb->isAffects(3,33));
	CPPUNIT_ASSERT(!pkb->isAffects(3,34));

	CPPUNIT_ASSERT(!pkb->isAffects(4,1));
	CPPUNIT_ASSERT(!pkb->isAffects(4,3));
	CPPUNIT_ASSERT(!pkb->isAffects(4,4));
	CPPUNIT_ASSERT(pkb->isAffects(4,6));
	CPPUNIT_ASSERT(!pkb->isAffects(4,7));
	CPPUNIT_ASSERT(pkb->isAffects(4,9));
	CPPUNIT_ASSERT(!pkb->isAffects(4,11));
	CPPUNIT_ASSERT(!pkb->isAffects(4,14));
	CPPUNIT_ASSERT(!pkb->isAffects(4,16));
	CPPUNIT_ASSERT(!pkb->isAffects(4,17));
	CPPUNIT_ASSERT(!pkb->isAffects(4,18));
	CPPUNIT_ASSERT(!pkb->isAffects(4,20));
	CPPUNIT_ASSERT(!pkb->isAffects(4,21));
	CPPUNIT_ASSERT(!pkb->isAffects(4,22));
	CPPUNIT_ASSERT(!pkb->isAffects(4,23));
	CPPUNIT_ASSERT(!pkb->isAffects(4,26));
	CPPUNIT_ASSERT(!pkb->isAffects(4,27));
	CPPUNIT_ASSERT(!pkb->isAffects(4,29));
	CPPUNIT_ASSERT(!pkb->isAffects(4,31));
	CPPUNIT_ASSERT(!pkb->isAffects(4,32));
	CPPUNIT_ASSERT(!pkb->isAffects(4,33));
	CPPUNIT_ASSERT(!pkb->isAffects(4,34));

	CPPUNIT_ASSERT(!pkb->isAffects(6,1));
	CPPUNIT_ASSERT(!pkb->isAffects(6,3));
	CPPUNIT_ASSERT(!pkb->isAffects(6,4));
	CPPUNIT_ASSERT(!pkb->isAffects(6,6));
	CPPUNIT_ASSERT(!pkb->isAffects(6,7));
	CPPUNIT_ASSERT(!pkb->isAffects(6,9));
	CPPUNIT_ASSERT(pkb->isAffects(6,11));
	CPPUNIT_ASSERT(!pkb->isAffects(6,14));
	CPPUNIT_ASSERT(!pkb->isAffects(6,16));
	CPPUNIT_ASSERT(!pkb->isAffects(6,17));
	CPPUNIT_ASSERT(!pkb->isAffects(6,18));
	CPPUNIT_ASSERT(!pkb->isAffects(6,20));
	CPPUNIT_ASSERT(!pkb->isAffects(6,21));
	CPPUNIT_ASSERT(!pkb->isAffects(6,22));
	CPPUNIT_ASSERT(!pkb->isAffects(6,23));
	CPPUNIT_ASSERT(!pkb->isAffects(6,26));
	CPPUNIT_ASSERT(!pkb->isAffects(6,27));
	CPPUNIT_ASSERT(!pkb->isAffects(6,29));
	CPPUNIT_ASSERT(!pkb->isAffects(6,31));
	CPPUNIT_ASSERT(!pkb->isAffects(6,32));
	CPPUNIT_ASSERT(!pkb->isAffects(6,33));
	CPPUNIT_ASSERT(!pkb->isAffects(6,34));

	CPPUNIT_ASSERT(!pkb->isAffects(7,1));
	CPPUNIT_ASSERT(!pkb->isAffects(7,3));
	CPPUNIT_ASSERT(!pkb->isAffects(7,4));
	CPPUNIT_ASSERT(!pkb->isAffects(7,6));
	CPPUNIT_ASSERT(!pkb->isAffects(7,7));
	CPPUNIT_ASSERT(pkb->isAffects(7,9));
	CPPUNIT_ASSERT(pkb->isAffects(7,11));
	CPPUNIT_ASSERT(!pkb->isAffects(7,14));
	CPPUNIT_ASSERT(!pkb->isAffects(7,16));
	CPPUNIT_ASSERT(!pkb->isAffects(7,17));
	CPPUNIT_ASSERT(!pkb->isAffects(7,18));
	CPPUNIT_ASSERT(!pkb->isAffects(7,20));
	CPPUNIT_ASSERT(!pkb->isAffects(7,21));
	CPPUNIT_ASSERT(!pkb->isAffects(7,22));
	CPPUNIT_ASSERT(!pkb->isAffects(7,23));
	CPPUNIT_ASSERT(!pkb->isAffects(7,26));
	CPPUNIT_ASSERT(!pkb->isAffects(7,27));
	CPPUNIT_ASSERT(!pkb->isAffects(7,29));
	CPPUNIT_ASSERT(!pkb->isAffects(7,31));
	CPPUNIT_ASSERT(!pkb->isAffects(7,32));
	CPPUNIT_ASSERT(!pkb->isAffects(7,33));
	CPPUNIT_ASSERT(!pkb->isAffects(7,34));

	CPPUNIT_ASSERT(!pkb->isAffects(9,1));
	CPPUNIT_ASSERT(!pkb->isAffects(9,3));
	CPPUNIT_ASSERT(!pkb->isAffects(9,4));
	CPPUNIT_ASSERT(!pkb->isAffects(9,6));
	CPPUNIT_ASSERT(!pkb->isAffects(9,7));
	CPPUNIT_ASSERT(!pkb->isAffects(9,9));
	CPPUNIT_ASSERT(!pkb->isAffects(9,11));
	CPPUNIT_ASSERT(!pkb->isAffects(9,14));
	CPPUNIT_ASSERT(!pkb->isAffects(9,16));
	CPPUNIT_ASSERT(!pkb->isAffects(9,17));
	CPPUNIT_ASSERT(!pkb->isAffects(9,18));
	CPPUNIT_ASSERT(!pkb->isAffects(9,20));
	CPPUNIT_ASSERT(!pkb->isAffects(9,21));
	CPPUNIT_ASSERT(!pkb->isAffects(9,22));
	CPPUNIT_ASSERT(!pkb->isAffects(9,23));
	CPPUNIT_ASSERT(!pkb->isAffects(9,26));
	CPPUNIT_ASSERT(!pkb->isAffects(9,27));
	CPPUNIT_ASSERT(!pkb->isAffects(9,29));
	CPPUNIT_ASSERT(!pkb->isAffects(9,31));
	CPPUNIT_ASSERT(!pkb->isAffects(9,32));
	CPPUNIT_ASSERT(!pkb->isAffects(9,33));
	CPPUNIT_ASSERT(!pkb->isAffects(9,34));

	CPPUNIT_ASSERT(!pkb->isAffects(11,1));
	CPPUNIT_ASSERT(!pkb->isAffects(11,3));
	CPPUNIT_ASSERT(!pkb->isAffects(11,4));
	CPPUNIT_ASSERT(!pkb->isAffects(11,6));
	CPPUNIT_ASSERT(!pkb->isAffects(11,7));
	CPPUNIT_ASSERT(!pkb->isAffects(11,9));
	CPPUNIT_ASSERT(!pkb->isAffects(11,11));
	CPPUNIT_ASSERT(!pkb->isAffects(11,14));
	CPPUNIT_ASSERT(!pkb->isAffects(11,16));
	CPPUNIT_ASSERT(!pkb->isAffects(11,17));
	CPPUNIT_ASSERT(!pkb->isAffects(11,18));
	CPPUNIT_ASSERT(!pkb->isAffects(11,20));
	CPPUNIT_ASSERT(!pkb->isAffects(11,21));
	CPPUNIT_ASSERT(!pkb->isAffects(11,22));
	CPPUNIT_ASSERT(!pkb->isAffects(11,23));
	CPPUNIT_ASSERT(!pkb->isAffects(11,26));
	CPPUNIT_ASSERT(!pkb->isAffects(11,27));
	CPPUNIT_ASSERT(!pkb->isAffects(11,29));
	CPPUNIT_ASSERT(!pkb->isAffects(11,31));
	CPPUNIT_ASSERT(!pkb->isAffects(11,32));
	CPPUNIT_ASSERT(!pkb->isAffects(11,33));
	CPPUNIT_ASSERT(!pkb->isAffects(11,34));

	CPPUNIT_ASSERT(!pkb->isAffects(14,1));
	CPPUNIT_ASSERT(!pkb->isAffects(14,3));
	CPPUNIT_ASSERT(!pkb->isAffects(14,4));
	CPPUNIT_ASSERT(!pkb->isAffects(14,6));
	CPPUNIT_ASSERT(!pkb->isAffects(14,7));
	CPPUNIT_ASSERT(!pkb->isAffects(14,9));
	CPPUNIT_ASSERT(!pkb->isAffects(14,11));
	CPPUNIT_ASSERT(!pkb->isAffects(14,14));
	CPPUNIT_ASSERT(!pkb->isAffects(14,16));
	CPPUNIT_ASSERT(pkb->isAffects(14,17));
	CPPUNIT_ASSERT(!pkb->isAffects(14,18));
	CPPUNIT_ASSERT(!pkb->isAffects(14,20));
	CPPUNIT_ASSERT(!pkb->isAffects(14,21));
	CPPUNIT_ASSERT(!pkb->isAffects(14,22));
	CPPUNIT_ASSERT(!pkb->isAffects(14,23));
	CPPUNIT_ASSERT(!pkb->isAffects(14,26));
	CPPUNIT_ASSERT(!pkb->isAffects(14,29));
	CPPUNIT_ASSERT(!pkb->isAffects(14,31));
	CPPUNIT_ASSERT(!pkb->isAffects(14,32));
	CPPUNIT_ASSERT(!pkb->isAffects(14,33));
	CPPUNIT_ASSERT(!pkb->isAffects(14,34));

	CPPUNIT_ASSERT(!pkb->isAffects(16,1));
	CPPUNIT_ASSERT(!pkb->isAffects(16,3));
	CPPUNIT_ASSERT(!pkb->isAffects(16,4));
	CPPUNIT_ASSERT(!pkb->isAffects(16,6));
	CPPUNIT_ASSERT(!pkb->isAffects(16,7));
	CPPUNIT_ASSERT(!pkb->isAffects(16,9));
	CPPUNIT_ASSERT(!pkb->isAffects(16,11));
	CPPUNIT_ASSERT(pkb->isAffects(16,14));
	CPPUNIT_ASSERT(!pkb->isAffects(16,16));
	CPPUNIT_ASSERT(pkb->isAffects(16,17));
	CPPUNIT_ASSERT(pkb->isAffects(16,18));
	CPPUNIT_ASSERT(!pkb->isAffects(16,20));
	CPPUNIT_ASSERT(!pkb->isAffects(16,21));
	CPPUNIT_ASSERT(!pkb->isAffects(16,22));
	CPPUNIT_ASSERT(!pkb->isAffects(16,23));
	CPPUNIT_ASSERT(!pkb->isAffects(16,26));
	CPPUNIT_ASSERT(!pkb->isAffects(16,27));
	CPPUNIT_ASSERT(!pkb->isAffects(16,29));
	CPPUNIT_ASSERT(!pkb->isAffects(16,31));
	CPPUNIT_ASSERT(!pkb->isAffects(16,32));
	CPPUNIT_ASSERT(!pkb->isAffects(16,33));
	CPPUNIT_ASSERT(!pkb->isAffects(16,34));

	CPPUNIT_ASSERT(!pkb->isAffects(17,1));
	CPPUNIT_ASSERT(!pkb->isAffects(17,3));
	CPPUNIT_ASSERT(!pkb->isAffects(17,4));
	CPPUNIT_ASSERT(!pkb->isAffects(17,6));
	CPPUNIT_ASSERT(!pkb->isAffects(17,7));
	CPPUNIT_ASSERT(!pkb->isAffects(17,9));
	CPPUNIT_ASSERT(!pkb->isAffects(17,11));
	CPPUNIT_ASSERT(!pkb->isAffects(17,14));
	CPPUNIT_ASSERT(!pkb->isAffects(17,16));
	CPPUNIT_ASSERT(!pkb->isAffects(17,17));
	CPPUNIT_ASSERT(!pkb->isAffects(17,18));
	CPPUNIT_ASSERT(pkb->isAffects(17,20));
	CPPUNIT_ASSERT(!pkb->isAffects(17,21));
	CPPUNIT_ASSERT(pkb->isAffects(17,22));
	CPPUNIT_ASSERT(!pkb->isAffects(17,23));
	CPPUNIT_ASSERT(!pkb->isAffects(17,26));
	CPPUNIT_ASSERT(!pkb->isAffects(17,27));
	CPPUNIT_ASSERT(!pkb->isAffects(17,29));
	CPPUNIT_ASSERT(!pkb->isAffects(17,31));
	CPPUNIT_ASSERT(!pkb->isAffects(17,32));
	CPPUNIT_ASSERT(!pkb->isAffects(17,33));
	CPPUNIT_ASSERT(!pkb->isAffects(17,34));

	CPPUNIT_ASSERT(!pkb->isAffects(18,1));
	CPPUNIT_ASSERT(!pkb->isAffects(18,3));
	CPPUNIT_ASSERT(!pkb->isAffects(18,4));
	CPPUNIT_ASSERT(!pkb->isAffects(18,6));
	CPPUNIT_ASSERT(!pkb->isAffects(18,7));
	CPPUNIT_ASSERT(!pkb->isAffects(18,9));
	CPPUNIT_ASSERT(!pkb->isAffects(18,11));
	CPPUNIT_ASSERT(!pkb->isAffects(18,14));
	CPPUNIT_ASSERT(pkb->isAffects(18,16));
	CPPUNIT_ASSERT(!pkb->isAffects(18,17));
	CPPUNIT_ASSERT(!pkb->isAffects(18,18));
	CPPUNIT_ASSERT(!pkb->isAffects(18,20));
	CPPUNIT_ASSERT(!pkb->isAffects(18,21));
	CPPUNIT_ASSERT(pkb->isAffects(18,22));
	CPPUNIT_ASSERT(!pkb->isAffects(18,23));
	CPPUNIT_ASSERT(!pkb->isAffects(18,26));
	CPPUNIT_ASSERT(!pkb->isAffects(18,27));
	CPPUNIT_ASSERT(!pkb->isAffects(18,29));
	CPPUNIT_ASSERT(!pkb->isAffects(18,31));
	CPPUNIT_ASSERT(!pkb->isAffects(18,32));
	CPPUNIT_ASSERT(!pkb->isAffects(18,33));
	CPPUNIT_ASSERT(!pkb->isAffects(18,34));

	CPPUNIT_ASSERT(!pkb->isAffects(20,1));
	CPPUNIT_ASSERT(!pkb->isAffects(20,3));
	CPPUNIT_ASSERT(!pkb->isAffects(20,4));
	CPPUNIT_ASSERT(!pkb->isAffects(20,6));
	CPPUNIT_ASSERT(!pkb->isAffects(20,7));
	CPPUNIT_ASSERT(!pkb->isAffects(20,9));
	CPPUNIT_ASSERT(!pkb->isAffects(20,11));
	CPPUNIT_ASSERT(pkb->isAffects(20,14));
	CPPUNIT_ASSERT(!pkb->isAffects(20,16));
	CPPUNIT_ASSERT(pkb->isAffects(20,17));
	CPPUNIT_ASSERT(pkb->isAffects(20,18));
	CPPUNIT_ASSERT(pkb->isAffects(20,20));
	CPPUNIT_ASSERT(pkb->isAffects(20,21));
	CPPUNIT_ASSERT(pkb->isAffects(20,22));
	CPPUNIT_ASSERT(!pkb->isAffects(20,23));
	CPPUNIT_ASSERT(!pkb->isAffects(20,26));
	CPPUNIT_ASSERT(!pkb->isAffects(20,27));
	CPPUNIT_ASSERT(!pkb->isAffects(20,29));
	CPPUNIT_ASSERT(!pkb->isAffects(20,31));
	CPPUNIT_ASSERT(!pkb->isAffects(20,32));
	CPPUNIT_ASSERT(!pkb->isAffects(20,33));
	CPPUNIT_ASSERT(!pkb->isAffects(20,34));

	CPPUNIT_ASSERT(!pkb->isAffects(21,1));
	CPPUNIT_ASSERT(!pkb->isAffects(21,3));
	CPPUNIT_ASSERT(!pkb->isAffects(21,4));
	CPPUNIT_ASSERT(!pkb->isAffects(21,6));
	CPPUNIT_ASSERT(!pkb->isAffects(21,7));
	CPPUNIT_ASSERT(!pkb->isAffects(21,9));
	CPPUNIT_ASSERT(!pkb->isAffects(21,11));
	CPPUNIT_ASSERT(!pkb->isAffects(21,14));
	CPPUNIT_ASSERT(pkb->isAffects(21,16));
	CPPUNIT_ASSERT(!pkb->isAffects(21,17));
	CPPUNIT_ASSERT(!pkb->isAffects(21,18));
	CPPUNIT_ASSERT(!pkb->isAffects(21,20));
	CPPUNIT_ASSERT(!pkb->isAffects(21,21));
	CPPUNIT_ASSERT(pkb->isAffects(21,22));
	CPPUNIT_ASSERT(!pkb->isAffects(21,23));
	CPPUNIT_ASSERT(!pkb->isAffects(21,26));
	CPPUNIT_ASSERT(!pkb->isAffects(21,27));
	CPPUNIT_ASSERT(!pkb->isAffects(21,29));
	CPPUNIT_ASSERT(!pkb->isAffects(21,31));
	CPPUNIT_ASSERT(!pkb->isAffects(21,32));
	CPPUNIT_ASSERT(!pkb->isAffects(21,33));
	CPPUNIT_ASSERT(!pkb->isAffects(21,34));

	CPPUNIT_ASSERT(!pkb->isAffects(22,1));
	CPPUNIT_ASSERT(!pkb->isAffects(22,3));
	CPPUNIT_ASSERT(!pkb->isAffects(22,4));
	CPPUNIT_ASSERT(!pkb->isAffects(22,6));
	CPPUNIT_ASSERT(!pkb->isAffects(22,7));
	CPPUNIT_ASSERT(!pkb->isAffects(22,9));
	CPPUNIT_ASSERT(!pkb->isAffects(22,11));
	CPPUNIT_ASSERT(!pkb->isAffects(22,14));
	CPPUNIT_ASSERT(pkb->isAffects(22,16));
	CPPUNIT_ASSERT(!pkb->isAffects(22,17));
	CPPUNIT_ASSERT(!pkb->isAffects(22,18));
	CPPUNIT_ASSERT(!pkb->isAffects(22,20));
	CPPUNIT_ASSERT(!pkb->isAffects(22,21));
	CPPUNIT_ASSERT(!pkb->isAffects(22,22));
	CPPUNIT_ASSERT(!pkb->isAffects(22,23));
	CPPUNIT_ASSERT(!pkb->isAffects(22,26));
	CPPUNIT_ASSERT(!pkb->isAffects(22,27));
	CPPUNIT_ASSERT(!pkb->isAffects(22,29));
	CPPUNIT_ASSERT(!pkb->isAffects(22,31));
	CPPUNIT_ASSERT(!pkb->isAffects(22,32));
	CPPUNIT_ASSERT(!pkb->isAffects(22,33));
	CPPUNIT_ASSERT(!pkb->isAffects(22,34));

	CPPUNIT_ASSERT(!pkb->isAffects(23,1));
	CPPUNIT_ASSERT(!pkb->isAffects(23,3));
	CPPUNIT_ASSERT(!pkb->isAffects(23,4));
	CPPUNIT_ASSERT(!pkb->isAffects(23,6));
	CPPUNIT_ASSERT(!pkb->isAffects(23,7));
	CPPUNIT_ASSERT(!pkb->isAffects(23,9));
	CPPUNIT_ASSERT(!pkb->isAffects(23,11));
	CPPUNIT_ASSERT(!pkb->isAffects(23,14));
	CPPUNIT_ASSERT(!pkb->isAffects(23,16));
	CPPUNIT_ASSERT(!pkb->isAffects(23,17));
	CPPUNIT_ASSERT(!pkb->isAffects(23,18));
	CPPUNIT_ASSERT(!pkb->isAffects(23,20));
	CPPUNIT_ASSERT(!pkb->isAffects(23,21));
	CPPUNIT_ASSERT(!pkb->isAffects(23,22));
	CPPUNIT_ASSERT(!pkb->isAffects(23,23));
	CPPUNIT_ASSERT(!pkb->isAffects(23,26));
	CPPUNIT_ASSERT(!pkb->isAffects(23,27));
	CPPUNIT_ASSERT(!pkb->isAffects(23,29));
	CPPUNIT_ASSERT(!pkb->isAffects(23,31));
	CPPUNIT_ASSERT(!pkb->isAffects(23,32));
	CPPUNIT_ASSERT(!pkb->isAffects(23,33));
	CPPUNIT_ASSERT(!pkb->isAffects(23,34));

	CPPUNIT_ASSERT(!pkb->isAffects(26,1));
	CPPUNIT_ASSERT(!pkb->isAffects(26,3));
	CPPUNIT_ASSERT(!pkb->isAffects(26,4));
	CPPUNIT_ASSERT(!pkb->isAffects(26,6));
	CPPUNIT_ASSERT(!pkb->isAffects(26,7));
	CPPUNIT_ASSERT(!pkb->isAffects(26,9));
	CPPUNIT_ASSERT(!pkb->isAffects(26,11));
	CPPUNIT_ASSERT(!pkb->isAffects(26,14));
	CPPUNIT_ASSERT(!pkb->isAffects(26,16));
	CPPUNIT_ASSERT(!pkb->isAffects(26,17));
	CPPUNIT_ASSERT(!pkb->isAffects(26,18));
	CPPUNIT_ASSERT(!pkb->isAffects(26,20));
	CPPUNIT_ASSERT(!pkb->isAffects(26,21));
	CPPUNIT_ASSERT(!pkb->isAffects(26,22));
	CPPUNIT_ASSERT(!pkb->isAffects(26,23));
	CPPUNIT_ASSERT(!pkb->isAffects(26,26));
	CPPUNIT_ASSERT(!pkb->isAffects(26,27));
	CPPUNIT_ASSERT(!pkb->isAffects(26,29));
	CPPUNIT_ASSERT(!pkb->isAffects(26,31));
	CPPUNIT_ASSERT(!pkb->isAffects(26,32));
	CPPUNIT_ASSERT(!pkb->isAffects(26,33));
	CPPUNIT_ASSERT(!pkb->isAffects(26,34));

	CPPUNIT_ASSERT(!pkb->isAffects(27,1));
	CPPUNIT_ASSERT(!pkb->isAffects(27,3));
	CPPUNIT_ASSERT(!pkb->isAffects(27,4));
	CPPUNIT_ASSERT(!pkb->isAffects(27,6));
	CPPUNIT_ASSERT(!pkb->isAffects(27,7));
	CPPUNIT_ASSERT(!pkb->isAffects(27,9));
	CPPUNIT_ASSERT(!pkb->isAffects(27,11));
	CPPUNIT_ASSERT(!pkb->isAffects(27,14));
	CPPUNIT_ASSERT(!pkb->isAffects(27,16));
	CPPUNIT_ASSERT(!pkb->isAffects(27,17));
	CPPUNIT_ASSERT(!pkb->isAffects(27,18));
	CPPUNIT_ASSERT(!pkb->isAffects(27,20));
	CPPUNIT_ASSERT(!pkb->isAffects(27,21));
	CPPUNIT_ASSERT(!pkb->isAffects(27,22));
	CPPUNIT_ASSERT(!pkb->isAffects(27,23));
	CPPUNIT_ASSERT(!pkb->isAffects(27,26));
	CPPUNIT_ASSERT(!pkb->isAffects(27,27));
	CPPUNIT_ASSERT(pkb->isAffects(27,29));
	CPPUNIT_ASSERT(!pkb->isAffects(27,31));
	CPPUNIT_ASSERT(pkb->isAffects(27,32));
	CPPUNIT_ASSERT(!pkb->isAffects(27,33));
	CPPUNIT_ASSERT(pkb->isAffects(27,34));

	CPPUNIT_ASSERT(!pkb->isAffects(29,1));
	CPPUNIT_ASSERT(!pkb->isAffects(29,3));
	CPPUNIT_ASSERT(!pkb->isAffects(29,4));
	CPPUNIT_ASSERT(!pkb->isAffects(29,6));
	CPPUNIT_ASSERT(!pkb->isAffects(29,7));
	CPPUNIT_ASSERT(!pkb->isAffects(29,9));
	CPPUNIT_ASSERT(!pkb->isAffects(29,11));
	CPPUNIT_ASSERT(!pkb->isAffects(29,14));
	CPPUNIT_ASSERT(!pkb->isAffects(29,16));
	CPPUNIT_ASSERT(!pkb->isAffects(29,17));
	CPPUNIT_ASSERT(!pkb->isAffects(29,18));
	CPPUNIT_ASSERT(!pkb->isAffects(29,20));
	CPPUNIT_ASSERT(!pkb->isAffects(29,21));
	CPPUNIT_ASSERT(!pkb->isAffects(29,22));
	CPPUNIT_ASSERT(!pkb->isAffects(29,23));
	CPPUNIT_ASSERT(!pkb->isAffects(29,26));
	CPPUNIT_ASSERT(!pkb->isAffects(29,27));
	CPPUNIT_ASSERT(!pkb->isAffects(29,29));
	CPPUNIT_ASSERT(!pkb->isAffects(29,31));
	CPPUNIT_ASSERT(!pkb->isAffects(29,32));
	CPPUNIT_ASSERT(!pkb->isAffects(29,33));
	CPPUNIT_ASSERT(!pkb->isAffects(29,34));

	CPPUNIT_ASSERT(!pkb->isAffects(31,1));
	CPPUNIT_ASSERT(!pkb->isAffects(31,3));
	CPPUNIT_ASSERT(!pkb->isAffects(31,4));
	CPPUNIT_ASSERT(!pkb->isAffects(31,6));
	CPPUNIT_ASSERT(!pkb->isAffects(31,7));
	CPPUNIT_ASSERT(!pkb->isAffects(31,9));
	CPPUNIT_ASSERT(!pkb->isAffects(31,11));
	CPPUNIT_ASSERT(!pkb->isAffects(31,14));
	CPPUNIT_ASSERT(!pkb->isAffects(31,16));
	CPPUNIT_ASSERT(!pkb->isAffects(31,17));
	CPPUNIT_ASSERT(!pkb->isAffects(31,18));
	CPPUNIT_ASSERT(!pkb->isAffects(31,20));
	CPPUNIT_ASSERT(!pkb->isAffects(31,21));
	CPPUNIT_ASSERT(!pkb->isAffects(31,22));
	CPPUNIT_ASSERT(!pkb->isAffects(31,23));
	CPPUNIT_ASSERT(!pkb->isAffects(31,26));
	CPPUNIT_ASSERT(!pkb->isAffects(31,27));
	CPPUNIT_ASSERT(!pkb->isAffects(31,29));
	CPPUNIT_ASSERT(!pkb->isAffects(31,31));
	CPPUNIT_ASSERT(pkb->isAffects(31,32));
	CPPUNIT_ASSERT(pkb->isAffects(31,33));
	CPPUNIT_ASSERT(pkb->isAffects(31,34));

	CPPUNIT_ASSERT(!pkb->isAffects(32,1));
	CPPUNIT_ASSERT(!pkb->isAffects(32,3));
	CPPUNIT_ASSERT(!pkb->isAffects(32,4));
	CPPUNIT_ASSERT(!pkb->isAffects(32,6));
	CPPUNIT_ASSERT(!pkb->isAffects(32,7));
	CPPUNIT_ASSERT(!pkb->isAffects(32,9));
	CPPUNIT_ASSERT(!pkb->isAffects(32,11));
	CPPUNIT_ASSERT(!pkb->isAffects(32,14));
	CPPUNIT_ASSERT(!pkb->isAffects(32,16));
	CPPUNIT_ASSERT(!pkb->isAffects(32,17));
	CPPUNIT_ASSERT(!pkb->isAffects(32,18));
	CPPUNIT_ASSERT(!pkb->isAffects(32,20));
	CPPUNIT_ASSERT(!pkb->isAffects(32,21));
	CPPUNIT_ASSERT(!pkb->isAffects(32,22));
	CPPUNIT_ASSERT(!pkb->isAffects(32,23));
	CPPUNIT_ASSERT(!pkb->isAffects(32,26));
	CPPUNIT_ASSERT(!pkb->isAffects(32,27));
	CPPUNIT_ASSERT(!pkb->isAffects(32,29));
	CPPUNIT_ASSERT(pkb->isAffects(32,31));
	CPPUNIT_ASSERT(!pkb->isAffects(32,32));
	CPPUNIT_ASSERT(!pkb->isAffects(32,33));
	CPPUNIT_ASSERT(!pkb->isAffects(32,34));

	CPPUNIT_ASSERT(!pkb->isAffects(33,1));
	CPPUNIT_ASSERT(!pkb->isAffects(33,3));
	CPPUNIT_ASSERT(!pkb->isAffects(33,4));
	CPPUNIT_ASSERT(!pkb->isAffects(33,6));
	CPPUNIT_ASSERT(!pkb->isAffects(33,7));
	CPPUNIT_ASSERT(!pkb->isAffects(33,9));
	CPPUNIT_ASSERT(!pkb->isAffects(33,11));
	CPPUNIT_ASSERT(!pkb->isAffects(33,14));
	CPPUNIT_ASSERT(!pkb->isAffects(33,16));
	CPPUNIT_ASSERT(!pkb->isAffects(33,17));
	CPPUNIT_ASSERT(!pkb->isAffects(33,18));
	CPPUNIT_ASSERT(!pkb->isAffects(33,20));
	CPPUNIT_ASSERT(!pkb->isAffects(33,21));
	CPPUNIT_ASSERT(!pkb->isAffects(33,22));
	CPPUNIT_ASSERT(!pkb->isAffects(33,23));
	CPPUNIT_ASSERT(!pkb->isAffects(33,26));
	CPPUNIT_ASSERT(!pkb->isAffects(33,27));
	CPPUNIT_ASSERT(pkb->isAffects(33,29));
	CPPUNIT_ASSERT(!pkb->isAffects(33,31));
	CPPUNIT_ASSERT(pkb->isAffects(33,32));
	CPPUNIT_ASSERT(!pkb->isAffects(33,33));
	CPPUNIT_ASSERT(pkb->isAffects(33,34));

	CPPUNIT_ASSERT(!pkb->isAffects(34,1));
	CPPUNIT_ASSERT(!pkb->isAffects(34,3));
	CPPUNIT_ASSERT(!pkb->isAffects(34,4));
	CPPUNIT_ASSERT(!pkb->isAffects(34,6));
	CPPUNIT_ASSERT(!pkb->isAffects(34,7));
	CPPUNIT_ASSERT(!pkb->isAffects(34,9));
	CPPUNIT_ASSERT(!pkb->isAffects(34,11));
	CPPUNIT_ASSERT(!pkb->isAffects(34,14));
	CPPUNIT_ASSERT(!pkb->isAffects(34,16));
	CPPUNIT_ASSERT(!pkb->isAffects(34,17));
	CPPUNIT_ASSERT(!pkb->isAffects(34,18));
	CPPUNIT_ASSERT(!pkb->isAffects(34,20));
	CPPUNIT_ASSERT(!pkb->isAffects(34,21));
	CPPUNIT_ASSERT(!pkb->isAffects(34,22));
	CPPUNIT_ASSERT(!pkb->isAffects(34,23));
	CPPUNIT_ASSERT(!pkb->isAffects(34,26));
	CPPUNIT_ASSERT(!pkb->isAffects(34,27));
	CPPUNIT_ASSERT(!pkb->isAffects(34,29));
	CPPUNIT_ASSERT(!pkb->isAffects(34,31));
	CPPUNIT_ASSERT(!pkb->isAffects(34,32));
	CPPUNIT_ASSERT(!pkb->isAffects(34,33));
	CPPUNIT_ASSERT(!pkb->isAffects(34,34));

	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(1)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(2)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 4, (pkb->getAffected(3)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(4)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(5)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getAffected(6)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(7)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(8)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(9)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(10)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(11)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(12)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(13)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getAffected(14)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(15)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getAffected(16)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(17)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(18)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(19)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 6, (pkb->getAffected(20)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 2, (pkb->getAffected(21)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getAffected(22)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(23)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(24)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(25)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(26)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getAffected(27)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(28)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(29)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(30)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getAffected(31)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 1, (pkb->getAffected(32)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 3, (pkb->getAffected(33)).size());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, (pkb->getAffected(34)).size());

	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,6));
	CPPUNIT_ASSERT(pkb->isAffectsStar(1,7));
	CPPUNIT_ASSERT(pkb->isAffectsStar(1,9));
	CPPUNIT_ASSERT(pkb->isAffectsStar(1,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(1,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,4));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,6));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,7));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,9));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(3,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(3,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,4));
	CPPUNIT_ASSERT(pkb->isAffectsStar(4,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,7));
	CPPUNIT_ASSERT(pkb->isAffectsStar(4,9));
	CPPUNIT_ASSERT(pkb->isAffectsStar(4,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(4,34));


	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,9));
	CPPUNIT_ASSERT(pkb->isAffectsStar(6,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(6,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,7));
	CPPUNIT_ASSERT(pkb->isAffectsStar(7,9));
	CPPUNIT_ASSERT(pkb->isAffectsStar(7,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(7,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(9,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(11,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(14,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(14,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(16,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(16,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(17,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(17,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(18,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(18,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(20,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(20,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(21,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(21,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,11));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,14));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,16));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,17));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,18));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,20));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,21));
	CPPUNIT_ASSERT(pkb->isAffectsStar(22,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(22,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(23,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(26,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(27,27));
	CPPUNIT_ASSERT(pkb->isAffectsStar(27,29));
	CPPUNIT_ASSERT(pkb->isAffectsStar(27,31));
	CPPUNIT_ASSERT(pkb->isAffectsStar(27,32));
	CPPUNIT_ASSERT(pkb->isAffectsStar(27,33));
	CPPUNIT_ASSERT(pkb->isAffectsStar(27,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(29,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(31,27));
	CPPUNIT_ASSERT(pkb->isAffectsStar(31,29));
	CPPUNIT_ASSERT(pkb->isAffectsStar(31,31));
	CPPUNIT_ASSERT(pkb->isAffectsStar(31,32));
	CPPUNIT_ASSERT(pkb->isAffectsStar(31,33));
	CPPUNIT_ASSERT(pkb->isAffectsStar(31,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(32,27));
	CPPUNIT_ASSERT(pkb->isAffectsStar(32,29));
	CPPUNIT_ASSERT(pkb->isAffectsStar(32,31));
	CPPUNIT_ASSERT(pkb->isAffectsStar(32,32));
	CPPUNIT_ASSERT(pkb->isAffectsStar(32,33));
	CPPUNIT_ASSERT(pkb->isAffectsStar(32,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(33,27));
	CPPUNIT_ASSERT(pkb->isAffectsStar(33,29));
	CPPUNIT_ASSERT(pkb->isAffectsStar(33,31));
	CPPUNIT_ASSERT(pkb->isAffectsStar(33,32));
	CPPUNIT_ASSERT(pkb->isAffectsStar(33,33));
	CPPUNIT_ASSERT(pkb->isAffectsStar(33,34));

	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,1));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,3));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,4));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,6));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,7));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,9));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,11));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,14));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,16));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,17));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,18));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,20));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,21));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,22));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,23));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,26));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,27));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,29));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,31));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,32));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,33));
	CPPUNIT_ASSERT(!pkb->isAffectsStar(34,34));
}
void PKBRelationshipTest::testProc(){
	testInsertProc();
	testGetProc();

	testSetProcStartEnd();
	testGetProcStartEnd();
}

void PKBRelationshipTest::testVar(){
	testInsertVar();
	testGetVar();
}

void PKBRelationshipTest::testConstant(){
	testInsertConstant();
	testGetConstant();
}

void PKBRelationshipTest::testEntity(){
	testInsertLineEntity();
	testGetLineEntity();
}

void PKBRelationshipTest::testUses(){
	testSetUses();
	testGetUses();
}

void PKBRelationshipTest::testModifies(){
	testSetModifies();
	testGetModifes();
}

void PKBRelationshipTest::testAffects(){

	testInsertProc();
	testSetProcStartEnd();
	testInsertVar();
	testInsertLineEntity();
	testSetModifies();
	testSetUses();
	testSetParent();
	testSetFollow();
	testSetCall();
	testSetLastOfContainer();
	
	DesignExtractor* de = new DesignExtractor(PKB::getInstance());
	de->run();
	testGetAffects();
}

void PKBRelationshipTest::testCalls(){
	testSetCall();
	testGetCall();
}

void PKBRelationshipTest::testParent(){
	testSetParent();
	testGetParent();
}

void PKBRelationshipTest::testFollows(){
	testSetFollow();
	testGetFollow();
}

//QW's part
void PKBRelationshipTest::testGetChildStar(){
	std::cout<<std::endl<<"PKB Relationship getChildStar() - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();

	//set parent relation
	std::cout<<std::endl<<"Setting parent relation starts ..."<<std::endl;
	pkb->setParent(1,2);
	pkb->setParent(1,3);
	pkb->setParent(1,9);
	pkb->setParent(1,11);
	pkb->setParent(1,12);
	pkb->setParent(1,17);
	pkb->setParent(3,4);
	pkb->setParent(3,5);
	pkb->setParent(3,6);
	pkb->setParent(3,8);
	pkb->setParent(9,10);
	pkb->setParent(12,13);
	pkb->setParent(12,16);
	pkb->setParent(6,7);
	pkb->setParent(13,14);
	pkb->setParent(14,15);
	std::cout<<std::endl<<"Setting parent relation ends ..."<<std::endl;
	//get ChildStar
	std::cout<<std::endl<<"Setting Sample ..."<<std::endl;
	Type::Index::Line mychildstar[] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
	Type::List::Line childStarOfOneSample(&mychildstar[0],&mychildstar[0]+16);
	std::cout<<std::endl<<"Setting Sample ends..."<<std::endl;

	//Type::List::Line childStarOfOneSample (mychildstar, mychildstar + sizeof(mychildstar)/sizeof(Type::Index::Line));
	Type::List::Line childStarOfOne = pkb->getChildStar(1);
	std::sort(childStarOfOne.begin(),childStarOfOne.end());
	std::cout<<"childStarOfOne "<<std::endl;
	for(int k=0;k<childStarOfOne.size();k++){
		std::cout<<childStarOfOne.at(k)<<", ";
	}std::cout<<std::endl;
	std::cout<<"childStarOfOneSample "<<std::endl;
	for(int k=0;k<childStarOfOneSample.size();k++){
		std::cout<<childStarOfOneSample.at(k)<<", ";
	}std::cout<<std::endl;
	std::cout<<"Comparing ... "<<std::endl;
	CPPUNIT_ASSERT(childStarOfOne == childStarOfOneSample); //Match line 1 's Children and grandchildren
	std::cout<<"Comparing ... "<<std::endl;
	CPPUNIT_ASSERT(pkb->getChildStar(17).empty()==true); //Match line 17 's Children
	std::cout<<"Destroying ... "<<std::endl;
	pkb->~PKB();
	std::cout<<"Destroyed ... "<<std::endl;
}

void PKBRelationshipTest:: testSetGetCallRelation(){
	std::cout<<std::endl<<"PKB Relationship SetGetCalls - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,3);
	pkb->setCalls(2,3,1);
	pkb->setCalls(2,4,3);
	pkb->setCalls(3,5,1);
	pkb->setCalls(3,6,2);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	std::cout<<std::endl<<"PKB Relationship Get called procedure by procedure 1  ..."<<std::endl;
	//Get called procedure by procedure 1
	Type::Index::Proc calledProcSamplec1[] = {2,3};
	Type::List::Proc calledProcListSample1 (calledProcSamplec1, calledProcSamplec1 + sizeof(calledProcSamplec1)/sizeof(Type::Index::Line));
	Type::List::Proc calledProcList1 = pkb->getCalledBy(1);
	sort(calledProcList1.begin(),calledProcList1.end());
	CPPUNIT_ASSERT(calledProcListSample1 == calledProcList1);

	std::cout<<std::endl<<"PKB Relationship Get called procedure by line 1,6,7  ..."<<std::endl;
	//Get called procedure by line 1,6,7
	CPPUNIT_ASSERT_EQUAL(2, pkb->getCalledByLine(1));
	CPPUNIT_ASSERT_EQUAL(2, pkb->getCalledByLine(6));
	CPPUNIT_ASSERT_EQUAL(-1, pkb->getCalledByLine(7));

	std::cout<<std::endl<<"PKB Relationship Get caller of procedure 2  ..."<<std::endl;
	//Get caller of procedure 2
	Type::Index::Proc callerProcSamplec2[] = {1,3};
	Type::List::Proc callerProcListSample2 (callerProcSamplec2, callerProcSamplec2 + sizeof(callerProcSamplec2)/sizeof(Type::Index::Line));
	Type::List::Proc callerProcList2 = pkb->getCallerOf(2);
	sort(callerProcList2.begin(),callerProcList2.end());
	CPPUNIT_ASSERT(callerProcListSample2==callerProcList2);

	std::cout<<std::endl<<"PKB Relationship Get callerLine(which line calls procedure 3)  ..."<<std::endl;
	//Get callerLine(which line calls procedure 3)
	Type::Index::Line callerLineSamplec3[] = {2,4};
	Type::List::Line callerLineListSample3 (callerLineSamplec3, callerLineSamplec3 + sizeof(callerLineSamplec3)/sizeof(Type::Index::Line));
	Type::List::Line callerLineList3 = pkb->getCallerLineOf(3);
	sort(callerLineList3.begin(),callerLineList3.end());
	CPPUNIT_ASSERT(callerLineListSample3==callerLineList3);

	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(1,2));
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(1,3));
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(2,1));
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(2,3));
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(3,1));
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCalls(3,2));
	CPPUNIT_ASSERT_EQUAL(false, pkb->isCalls(6,2));

	std::cout<<"Destroying ... "<<std::endl;
	pkb->~PKB();
	std::cout<<"Destroyed ... "<<std::endl;
}

void PKBRelationshipTest::testGetCalledByStar(){
	std::cout<<std::endl<<"PKB Relationship GetCalledByStar - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,3);
	pkb->setCalls(2,3,3);
	pkb->setCalls(3,4,4);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	//get all procedure called by procedure 1
	Type::Index::Proc calledProcSamplec1[] = {2,3,4};
	Type::List::Proc calledProcListSample1 (calledProcSamplec1, calledProcSamplec1 + sizeof(calledProcSamplec1)/sizeof(Type::Index::Line));
	Type::List::Proc calledProcList1 = pkb->getCalledByStar(1);
	sort(calledProcList1.begin(),calledProcList1.end());
	for(int k=0;k<calledProcList1.size();k++){
		std::cout<<calledProcList1.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(calledProcListSample1 == calledProcList1);
}
void PKBRelationshipTest::testGetCalledByLineStar(){
	std::cout<<std::endl<<"PKB Relationship GetCalledByLineStar - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,3);
	pkb->setCalls(2,3,3);
	pkb->setCalls(3,4,4);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	//get all procedure called by line 1
	Type::Index::Proc calledProcSamplec1[] = {2,3,4};
	Type::List::Proc calledProcListSample1 (calledProcSamplec1, calledProcSamplec1 + sizeof(calledProcSamplec1)/sizeof(Type::Index::Line));
	Type::List::Proc calledProcList1 = pkb->getCalledByLineStar(1);
	sort(calledProcList1.begin(),calledProcList1.end());
	for(int k=0;k<calledProcList1.size();k++){
		std::cout<<calledProcList1.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(calledProcListSample1 == calledProcList1);
}
void PKBRelationshipTest::testGetCallerOfStar(){
	std::cout<<std::endl<<"PKB Relationship GetCallerOfStar - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,3);
	pkb->setCalls(2,3,3);
	pkb->setCalls(3,4,4);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	//get all procedure called by line 1
	Type::Index::Proc calledProcSamplec1[] = {1,2,3};
	Type::List::Proc calledProcListSample1 (calledProcSamplec1, calledProcSamplec1 + sizeof(calledProcSamplec1)/sizeof(Type::Index::Line));
	Type::List::Proc calledProcList1 = pkb->getCallerOfStar(4);
	sort(calledProcList1.begin(),calledProcList1.end());
	for(int k=0;k<calledProcList1.size();k++){
		std::cout<<calledProcList1.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(calledProcListSample1 == calledProcList1);
}
void PKBRelationshipTest::testGetCallerLineOfStar(){
	std::cout<<std::endl<<"PKB Relationship GetCallerLineOfStar - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,4);
	pkb->setCalls(2,3,3);
	pkb->setCalls(3,4,4);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	//get all line calling to procedure 4
	Type::Index::Proc calledProcSamplec1[] = {1,2,3,4};
	Type::List::Proc calledProcListSample1 (calledProcSamplec1, calledProcSamplec1 + sizeof(calledProcSamplec1)/sizeof(Type::Index::Line));
	Type::List::Proc calledProcList1 = pkb->getCallerLineOfStar(4);
	sort(calledProcList1.begin(),calledProcList1.end());
	for(int k=0;k<calledProcList1.size();k++){
		std::cout<<calledProcList1.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(calledProcListSample1 == calledProcList1);

}
void PKBRelationshipTest::testIstCallsStar(){
	std::cout<<std::endl<<"PKB Relationship IsCallsStar - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Calls ..."<<std::endl;
	//set call relationship
	pkb->setCalls(1,1,2);
	pkb->setCalls(1,2,3);
	pkb->setCalls(2,3,3);
	pkb->setCalls(3,4,4);
	std::cout<<std::endl<<"PKB Relationship Set Calls ends..."<<std::endl;

	std::cout<<std::endl<<"PKB Relationship isCallStar 1 2 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(1,2));
	std::cout<<std::endl<<"PKB Relationship isCallStar 1 3 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(1,3));
	std::cout<<std::endl<<"PKB Relationship isCallStar 1 4 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(1,4));
	std::cout<<std::endl<<"PKB Relationship isCallStar 2 3 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(2,3));
	std::cout<<std::endl<<"PKB Relationship isCallStar 2 4 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(2,4));
	std::cout<<std::endl<<"PKB Relationship isCallStar 3 4 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(true, pkb->isCallsStar(3,4));
	std::cout<<std::endl<<"PKB Relationship isCallStar 6 2 ends..."<<std::endl;
	CPPUNIT_ASSERT_EQUAL(false, pkb->isCallsStar(6,2));
}

void PKBRelationshipTest::testSetGetNextRelation(){
	std::cout<<std::endl<<"PKB Relationship SetGetNextRelation - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Next ..."<<std::endl;
	//set next relationship
	pkb->setNext(1,2);
	pkb->setNext(2,3);
	pkb->setNext(3,4);
	pkb->setNext(3,5);

	pkb->insertLineEntity(1, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(2, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(3, Type::Entity::IF_LINE_ENTITY);
	pkb->insertLineEntity(4, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(5, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	std::cout<<std::endl<<"PKB Relationship Set Next ends..."<<std::endl;

	//get successor of 3
	Type::Index::Proc samplec[] = {4,5};
	Type::List::Proc sample (samplec, samplec + sizeof(samplec)/sizeof(Type::Index::Line));
	Type::List::Proc successorList = pkb->getSuccessorNext(3);
	sort(successorList.begin(),successorList.end());
	for(int k=0;k<successorList.size();k++){
		std::cout<<successorList.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(sample == successorList);
}
void PKBRelationshipTest::testGetSuccessorNextStar(){
	std::cout<<std::endl<<"PKB Relationship SetGetNextRelation - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Next ..."<<std::endl;
	//set next relationship
	pkb->setNext(1,2);
	pkb->setNext(2,3);
	pkb->setNext(3,4);
	pkb->setNext(3,5);
	pkb->setNext(4,6);
	pkb->setNext(5,6);
	pkb->setNext(6,7);
	pkb->setNext(7,8);
	pkb->setNext(8,6);
	pkb->setNext(6,9);

	pkb->insertLineEntity(1, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(2, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(3, Type::Entity::IF_LINE_ENTITY);
	pkb->insertLineEntity(4, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(5, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(6, Type::Entity::WHILE_LINE_ENTITY);
	pkb->insertLineEntity(7, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(8, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(9, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	std::cout<<std::endl<<"PKB Relationship Set Next ends..."<<std::endl;

	//get successor of 1
	Type::Index::Proc samplec[] = {2,3,4,5,6,7,8,9};
	Type::List::Proc sample (samplec, samplec + sizeof(samplec)/sizeof(Type::Index::Line));
	Type::List::Proc successorList = pkb->getSuccessorNextStar(1);
	sort(successorList.begin(),successorList.end());
	for(int k=0;k<successorList.size();k++){
		std::cout<<successorList.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(sample == successorList);

	//get successor of 7
	Type::Index::Proc samplec2[] = {6,7,8,9};
	Type::List::Proc sample2 (samplec2, samplec2 + sizeof(samplec2)/sizeof(Type::Index::Line));
	Type::List::Proc successorList2 = pkb->getSuccessorNextStar(7);
	sort(successorList2.begin(),successorList2.end());
	for(int k=0;k<successorList2.size();k++){
		std::cout<<successorList2.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(sample2 == successorList2);
}
void PKBRelationshipTest::testGetPredecessorNextStar(){
	std::cout<<std::endl<<"PKB Relationship SetGetNextRelation - Entering ..."<<std::endl;
	PKB::initializeInstance();
	PKB* pkb = PKB::getInstance();
	std::cout<<std::endl<<"PKB Relationship Set Next ..."<<std::endl;
	//set next relationship
	pkb->setNext(1,2);
	pkb->setNext(2,3);
	pkb->setNext(3,4);
	pkb->setNext(3,5);
	pkb->setNext(4,6);
	pkb->setNext(5,6);
	pkb->setNext(6,7);
	pkb->setNext(7,8);
	pkb->setNext(8,6);
	pkb->setNext(6,9);

	pkb->insertLineEntity(1, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(2, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(3, Type::Entity::IF_LINE_ENTITY);
	pkb->insertLineEntity(4, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(5, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(6, Type::Entity::WHILE_LINE_ENTITY);
	pkb->insertLineEntity(7, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(8, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	pkb->insertLineEntity(9, Type::Entity::ASSIGNMENT_LINE_ENTITY);
	std::cout<<std::endl<<"PKB Relationship Set Next ends..."<<std::endl;

	//get predecessors of 9
	Type::Index::Proc samplec[] = {1,2,3,4,5,6,7,8};
	Type::List::Proc sample (samplec, samplec + sizeof(samplec)/sizeof(Type::Index::Line));
	Type::List::Proc successorList = pkb->getPredecessorNextStar(9);
	sort(successorList.begin(),successorList.end());
	for(int k=0;k<successorList.size();k++){
		std::cout<<successorList.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(sample == successorList);

	//get successor of 7
	Type::Index::Proc samplec2[] = {1,2,3,4,5,6,7,8};
	Type::List::Proc sample2 (samplec2, samplec2 + sizeof(samplec2)/sizeof(Type::Index::Line));
	Type::List::Proc successorList2 = pkb->getPredecessorNextStar(7);
	sort(successorList2.begin(),successorList2.end());
	for(int k=0;k<successorList2.size();k++){
		std::cout<<successorList2.at(k)<<", ";
	}std::cout<<std::endl;
	CPPUNIT_ASSERT(sample2 == successorList2);
}

//End of QW's part